home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / NotificationMon ƒ / NotificationMon.ƒ / Source / Printing.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-22  |  408 b   |  31 lines  |  [TEXT/KAHL]

  1. /*
  2.  
  3. */
  4.  
  5. #include <Printing.h>
  6.  
  7. short GetPrinterID()
  8. {
  9.     THPrint    tpr;
  10.     short    printerID;
  11.     short    err;
  12.     
  13.     tpr = NewHandle(sizeof(TPrint));
  14.     if(!tpr)    return -1;
  15.  
  16.     PrOpen();
  17.     if(err = PrError())
  18.     {
  19.             Debugger();
  20.     }
  21.     (void) PrValidate(tpr);        /* initialize print rec */
  22.                     /* get printer ID from high byte of wDev */
  23.     printerID = (**tpr).prStl.wDev >> 8;
  24.     
  25.     PrClose();
  26.     DisposHandle(tpr);
  27.     
  28.     return printerID;
  29.  
  30.